package com.linhngua.code.hibernate.core;

import java.io.Serializable;
import java.util.Collection;

import org.hibernate.SessionFactory;

public interface HibernateDataAccess<Key extends Serializable, Entity> {

	Entity load(Key key, Class<Entity> klass);

	void save(Entity entity);

	void update(Entity entity);

	void saveOrUpdate(Entity entity);

	void delete(Entity entity);
	
	Collection<Entity> loadAll(Class<Entity> klass);

	SessionFactory getSessionFactory();
	
	void close();
}
